import Vue from 'vue';
import router from '../router'
Vue.directive('permission',{
    inserted(el,binding){
        const action = binding.value?.action;
        const effect = binding.value?.effect;
        const right = router.currentRoute.meta.right;
        if(action&&right){
            if(right.includes(action)){
                console.log('有')
            }else{
                if(effect){
                    el.disabled = true;
                    el.classList.add('is-disabled')
                }else{
                    el.parentNode.removeChild(el)
                }
            }
        }
       
    }
})